{foreach from=$items item=folder key=folder_name}
<tr>
{if !$folder.loc}
    <td colspan="4">
    <strong class="folder">{$folder_name}</strong>
    </td>
</tr>
<tr>
    <td colspan="4" class="subdir-cov">
    <table class="subdir-cov" width="100%">
    {include file="cov_folder.tpl" items=$folder}
    </table>
    </td>
</tr>
{/if}
</tr>
{/foreach}
{foreach from=$items item=folder key=folder_name}
<tr>
{if $folder.loc}
    <td>
    {if $folder.link}<a class="file-link" href="{$folder.link}">{else}<span class="file-link">{/if}{$folder_name}{if $folder.link}</a>{else}</span>{/if}
    </td>
    <td width="130" style="text-align:right;">
        {if $folder.classes}
        {if $folder.methods == 0}
        {assign var="procmethods" value="0"}
        {else}
        {math equation="ce / e * 100" ce=$folder.coveredmethods e=$folder.methods assign="procmethods"}
        {/if}
        {assign var="pwidth" value=$procmethods/100*120}
        {math equation="120 - x" x=$pwidth|round assign="pwidth"}
        <span class="progressBar {if $procmethods|round >= 80}percentImage1{elseif $procmethods|round <= 30}percentImage4{else}percentImage2{/if}">
            <span class="cov-proc">{$folder.coveredmethods}/{$folder.methods} ({$procmethods|round:2}%)</span>
            <img style="width: 120px; height: 12px; background-position: -{$pwidth}px 50%;" src="{$subdir}media/images/percentImage.png"/>
        </span>
        {/if}
    </td>
    <td width="130" style="text-align:right;">
        {if $folder.statements == 0}
        {assign var="procstatements" value="0"}
        {else}
        {math equation="ce / e * 100" ce=$folder.coveredstatements e=$folder.statements assign="procstatements"}
        {/if}
        {assign var="pwidth" value=$procstatements/100*120}
        {math equation="120 - x" x=$pwidth|round assign="pwidth"}
        <span class="progressBar {if $procstatements|round >= 80}percentImage1{elseif $procstatements|round <= 30}percentImage4{else}percentImage2{/if}">
            <span class="cov-proc">{$folder.coveredstatements}/{$folder.statements} ({$procstatements|round:2}%)</span>
            <img style="width: 120px; height: 12px; background-position: -{$pwidth}px 50%;" src="{$subdir}media/images/percentImage.png"/>
        </span>
    </td>
    {*<td width="130" style="text-align:right;">
        {if $folder.elements == 0}
        {assign var="procelements" value="0"}
        {else}
        {math equation="ce / e * 100" ce=$folder.coveredelements e=$folder.elements assign="procelements"}
        {/if}
        {assign var="pwidth" value=$procelements/100*120}
        {math equation="120 - x" x=$pwidth|round assign="pwidth"}
        <span class="progressBar {if $procelements|round >= 80}percentImage1{elseif $procelements|round <= 30}percentImage4{else}percentImage2{/if}">
            <span class="cov-proc">{$folder.coveredelements}/{$folder.elements} ({$procelements|round:2}%)</span>
            <img style="width: 120px; height: 12px; background-position: -{$pwidth}px 50%;" src="{$subdir}media/images/percentImage.png"/>
        </span>
    </td>*}
{/if}
</tr>
{/foreach}